package com.link2room.jetfire.facade.impl;

import com.link2room.blaster.constant.MsgConstant;
import com.link2room.blaster.dto.innerUse.SMSAuthCodeParamDto;
import com.link2room.common.util.L2RAssert;
import com.link2room.jetfire.dto.param.api.ResrvationVerifyMSMApiParamDto;
import com.link2room.jetfire.facade.IResrvationVerifySMSFacadeService;
import com.link2room.jetfire.feign.blaster.SmsVerifyCodeFeignService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Created by LN on 2017/4/28.
 */
@Component("resrvationVerifySMSFacadeService")
public class ResrvationVerifySMSFacadeServiceImpl implements IResrvationVerifySMSFacadeService {
    @Resource
    private SmsVerifyCodeFeignService smsVerifyCodeFeignService;
    @Override
    public void sendVerifySMSCode(ResrvationVerifyMSMApiParamDto paramDto) throws Exception {
        String mobile = paramDto.getMobile();
        L2RAssert.stringBlank(mobile,"[mobile] is null.");
        String lhotelGroupCode = paramDto.getLhotelGroupCode();
        L2RAssert.stringBlank(lhotelGroupCode,"[lhotelGroupCode] is null.");
        SMSAuthCodeParamDto smsParamDto = new SMSAuthCodeParamDto();
        smsParamDto.setTemplateCode(MsgConstant.TEMPLET_CODE.LOGIN_VERIFICATION);
        smsParamDto.setSignName(MsgConstant.SIGN_NAME.LOGIN_VERIFY);
        smsParamDto.setMobile(paramDto.getMobile());
        smsVerifyCodeFeignService.sendSMSAuthCode(smsParamDto);
    }
}
